<template>
    <div>
        <p @click="edituserSonFn">我是子组件</p>
        <p>{{ $parent.userinfo.name }}--{{ $parent.userinfo.age }}</p>
        <p>{{ sonuser.name }}--{{ sonuser.age }}</p>
    </div>
</template>

<script>
export default {
    data() {
        return {
            sonuser: {}
        }
    },
    mounted() {
        // console.log('this-son', this);
        // console.log(this.$parent);
        this.sonuser = this.$parent.userinfo
    },
    methods: {
        edituserSonFn() {
            this.$parent.editUserinfoFn()

        }
    }
}
</script>
<style scoped></style>